﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _20170206_Game_1_1
{
    class Border : StaticGameObject
    {
        private int width;
        private int height;

        public Border(int x, int y, char symbol, int width, int height) : base(x, y, symbol)
        {
            Width = width;
            Height = height;
        }

        private int Width
        {
            get { return width; }
            set { width = value; }
        }

        private int Height
        {
            get { return height; }
            set { height = value; }
        }


        public override void Draw()
        {
            Console.SetCursorPosition(X, Y);
            for (int i = 0; i < Width; i++)
                Console.Write(Symbol);
            for (int i = 0; i < Height - 2; i++)
            {
                Console.SetCursorPosition(X, Y + i + 1);
                Console.Write(Symbol);
                for (int j = 0; j < Width - 2; j++)
                    Console.Write(' ');
                Console.WriteLine(Symbol);
            }
            Console.SetCursorPosition(X, Y + Height - 1);
            for (int i = 0; i < Width; i++)
                Console.Write(Symbol);
            Console.WriteLine();
        }
    }
}
